﻿@model ZoomLa.Model.M_UserInfo
@{
    //找回密码的方式
    string step = ViewBag.step;
    Layout = "~/Views/Shared/_empty.cshtml";
}
@section head{
<title>找回密码-@Call.SiteName</title>
}
@section content{
<center style="background: url(http://code.z01.com/user_login.jpg); background-position: center; left: 0; top: 0; right: 0; bottom: 0; position: absolute; background-repeat: no-repeat; background-size: cover;">
<form id="form1" method="post">
<div class="user_login">
<h3><span class="fa fa-refresh"></span>找回密码</h3>
<ul class="list-unstyled">
@switch (step)
{
    case "answer":
        {
            <li><i class="fa fa-user"></i><input type="text" id="TxtUserName" name="TxtUserName" placeholder="输入会员名" class="form-control text_max required" title="会员名不能为空" /></li>
            <li>密码问题：<input type="text" id="Question_T" name="Question_T" class="form-control text_max required" title="问题不能为空" placeholder="请输入问题" /></li>
            <li>密码答案：<input type="text" id="Answer_T" name="Answer_T" class="form-control text_max required" title="答案不能为空" placeholder="请输入答案" /></li>
            <li><input type="button" value="提交" class="btn btn-primary" onclick="submitform('@step');"/></li>
        }
        break;
    case "email":
        {
            <li><i class="fa fa-user"></i><input type="text" id="TxtUserName" name="TxtUserName" placeholder="输入会员名" class="form-control text_max required" title="会员名不能为空" /></li>
            <li class="margin_t5">
                <i class="fa fa-qrcode"></i>
                <div class="form-group">
                    <div>
                       @Html.Partial("Verify/Index")
                    </div>
                </div>
            </li>
            <li class="text-center margin_t5">
                <button type="button" class="btn btn-info margin_t5" onclick="submitform('email');">发送邮件</button>
                <button type="button" class="btn btn-info margin_t5" onclick="submitform('mobile');">发送短信</button>
            </li>
        }
        break;
    case "mobile_code":
        {
            <li><input type="text" id="CheckCode_T" name="CheckCode_T" class="form-control required" placeholder="请输入校验码" title="校验码不能为空" /></li>
            <li class="margin_t5"><input type="submit" id="ValidMobile_Btn" class="btn btn-info" value="验证手机" onclick="submitform('@step');" /></li>
        }
        break;
    case "final":
        {
            <li><input type="password" id="TxtPassword" name="TxtPassword" class="form-control" placeholder="新密码" /></li>
            <li class="margin_t5">
                <input type="password" id="TxtConfirmPassword" name="TxtConfirmPassword" class="form-control" placeholder="确认密码" />
                <input type="button" id="Final_Btn" onclick="submitform('@step');" class="btn btn-primary margin_t5" value="修改密码"/>
            </li>
        }
        break;
}
</ul>
</div>
</form>
</center>
}
@section script{
<script src="/JS/jquery.validate.min.js"></script>
<script>
$(function () {
    $("#TxtUserName").focus();
    $("form").validate({
        rules: {
            TxtPassword: { required: true },
            TxtConfirmPassword: { required: true, equalTo: "#TxtPassword" }
        }
    });
});
function submitform(type) {
    var $form = $("#form1");
    switch (type) {
        case "answer":
            $form.attr("action", "GetPassword_Answer");
            break;
        case "email":
            $form.attr("action", "GetPassword_Email");
            break;
        case "mobile":
            $form.attr("action", "GetPassword_Mobile");
            break;
        case "mobile_code":
            $form.attr("action", "GetPassword_Mobile_Code");
            break;
        case "final":
            $form.attr("action", "GetPassword_Final");
            break;
    }
    $form.submit();
}
</script>
}
